package com.atguigu.userprofile.util

import java.io.InputStreamReader
import java.util.Properties

/**
 * @Author: cpw
 * @Date: 2021/7/31 0:03
 * @Version 1.0
 */
object MyPropertiesUtil {

    def main(args: Array[String]): Unit = {
        val properties: Properties =  MyPropertiesUtil.load("config.properties")
        println(properties.getProperty("kafka.broker.list"))
    }

    def load(propertieName:String): Properties ={
        val prop=new Properties();
        prop.load(new InputStreamReader(Thread.currentThread().getContextClassLoader.
                getResourceAsStream(propertieName) , "UTF-8"))
        prop
    }

}
